package com.zengde.ai_sandbox.config;

import com.aliyun.oss.OSS;
import com.aliyun.oss.OSSClientBuilder;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class OssConfiguration {
    @Value("${oss.access-id}")
    private String accessKeyId;
    
    @Value("${oss.access-key}")
    private String accessKeySecret;
    
    @Value("${oss.endpoint}")
    private String endpoint;
    
    @Value("${oss.bucket-name}")
    private String bucketName;
    
    @Bean
    public OSS ossClient() {
        return new OSSClientBuilder().build(endpoint, accessKeyId, accessKeySecret);
    }
    
    public String getBucketName() {
        return bucketName;
    }
}
